<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{faAccountCategoryBean.id}"/>
		<f:event type="preRenderView" listener="#{faAccountCategoryBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Fa Account Category"/>

	<ui:define name="header">
		Fa Account Category
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty faAccountCategoryBean.id}">
				Edit existing Fa Account Category
			</c:when>
			<c:otherwise>
				Create a new Fa Account Category
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="faAccountCategoryBeanFaAccountCategoryAccCatNo" value="Acc Cat No:"/>
				<h:panelGroup>
					<h:inputText id="faAccountCategoryBeanFaAccountCategoryAccCatNo" required="true" value="#{faAccountCategoryBean.faAccountCategory.accCatNo}"/>
					<h:message for="faAccountCategoryBeanFaAccountCategoryAccCatNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="faAccountCategoryBeanFaAccountCategoryAccCatCode" value="Acc Cat Code:"/>
				<h:panelGroup>
					<h:inputText id="faAccountCategoryBeanFaAccountCategoryAccCatCode" maxLength="50" value="#{faAccountCategoryBean.faAccountCategory.accCatCode}"/>
					<h:message for="faAccountCategoryBeanFaAccountCategoryAccCatCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faAccountCategoryBeanFaAccountCategoryAccCatDescr" value="Acc Cat Descr:"/>
				<h:panelGroup>
					<h:inputText id="faAccountCategoryBeanFaAccountCategoryAccCatDescr" maxLength="300" value="#{faAccountCategoryBean.faAccountCategory.accCatDescr}"/>
					<h:message for="faAccountCategoryBeanFaAccountCategoryAccCatDescr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faAccountCategoryBeanFaAccountCategoryFaJournals" value="Fa Journals:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{faAccountCategoryBean.faAccountCategory.faJournals}"/>
					<h:dataTable id="faAccountCategoryBeanFaAccountCategoryFaJournals" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn No"/>
							</f:facet>
							<h:link outcome="/faJournal/view">
								<f:param name="id" value="#{_item.jnNo}"/>
								<h:outputText id="itemJnNo" value="#{_item.jnNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalBeanAddJnNo" value="#{faJournalBean.add.jnNo}"/>
								<h:message for="faJournalBeanAddJnNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Amt"/>
							</f:facet>
							<h:link outcome="/faJournal/view">
								<f:param name="id" value="#{_item.jnNo}"/>
								<h:outputText id="itemJnAmt" value="#{_item.jnAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalBeanAddJnAmt" value="#{faJournalBean.add.jnAmt}"/>
								<h:message for="faJournalBeanAddJnAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(faJournalBean.added)}" id="faAccountCategoryBeanFaAccountCategoryFaJournalsAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{faJournalBean.add.faAccountCategory}" value="#{faAccountCategoryBean.faAccountCategory}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faAccountCategoryBeanFaAccountCategoryFaGlTranses" value="Fa Gl Transes:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{faAccountCategoryBean.faAccountCategory.faGlTranses}"/>
					<h:dataTable id="faAccountCategoryBeanFaAccountCategoryFaGlTranses" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl No"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlNo" value="#{_item.glNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlNo" value="#{faGlTransBean.add.glNo}"/>
								<h:message for="faGlTransBeanAddGlNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Dr Amt"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlDrAmt" value="#{_item.glDrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlDrAmt" value="#{faGlTransBean.add.glDrAmt}"/>
								<h:message for="faGlTransBeanAddGlDrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Cr Amt"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlCrAmt" value="#{_item.glCrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlCrAmt" value="#{faGlTransBean.add.glCrAmt}"/>
								<h:message for="faGlTransBeanAddGlCrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Status Dr Cr"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlStatusDrCr" value="#{_item.glStatusDrCr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlStatusDrCr" value="#{faGlTransBean.add.glStatusDrCr}"/>
								<h:message for="faGlTransBeanAddGlStatusDrCr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Status Is Close"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlStatusIsClose" value="#{_item.glStatusIsClose}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlStatusIsClose" value="#{faGlTransBean.add.glStatusIsClose}"/>
								<h:message for="faGlTransBeanAddGlStatusIsClose" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(faGlTransBean.added)}" id="faAccountCategoryBeanFaAccountCategoryFaGlTransesAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{faGlTransBean.add.faAccountCategory}" value="#{faAccountCategoryBean.faAccountCategory}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{faAccountCategoryBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty faAccountCategoryBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{faAccountCategoryBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{faAccountCategoryBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>